package zhtt.action05_interceptor;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;

import java.io.IOException;

/**
 * Created by zhtt on 2017/4/18.
 */
@InterceptorRefs({
        @InterceptorRef("digitCertificateCheck"),
        @InterceptorRef(value="digitCertificateCheck",params={"authority_flag", "demo02"})
})
public class Demo02Action extends ActionSupport {

    @Action("demo02-1")
    public String doSomething() {
        try {
            ServletActionContext.getResponse().getOutputStream().write("Hello".getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}
